package seven.test_7_29;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long a = scanner.nextLong();
        long h = scanner.nextLong();
        long b = scanner.nextLong();
        long k = scanner.nextLong();
        long count = 0;
        while (k > 0 || h > 0) {
            if(k > 0 && h > 0) {
                count += a;
                count += b;
            } else if(h > 0) {
                count += (10 * a);
                break;
            } else if(k > 0) {
                count += (10 * b);
                break;
            }
            k -= a;
            h -= b;
        }
        System.out.println(count);
    }
}
